#include "stdio.h"

#define MAXLEN 1000
int main()
{
	int n=1,len=0,i;
    float read_value,store[MAXLEN],sum=0.0f,temp,max=0.0f;
	int cards[MAXLEN];
    scanf("%f",&read_value);
    while(read_value!=0.00f)
    {
		store[len]=read_value;
		cards[len]=0;
		if(read_value>max)
			max=read_value;
		len++;
        scanf("%f",&read_value);
	}

    n=1;
    sum=0.0f;
    do
    {
		temp=(1.0f/(float)(++n));
        sum+=temp;
		for(i=0;i<len;i++)
		{
			if(cards[i]==0 && sum>store[i])
				cards[i]=n-1;
		}
    }
    while(sum<max);
	
	for(i=0;i<len;i++)
	    printf("%d card(s)\n",cards[i]);
        
	return 0;
}

